function renderQues(data) {
	//			data = data.data;
	var qindex = 0; //题目的编号索引
	var action = 0;
	var swiper = new Swiper('.swiper-container', {
		loop: true,
		onInit: function(swiper) {
			var selectitems = swiper.slides[swiper.activeIndex].getElementsByClassName('selectitems');
			var length = selectitems.length;
			for (var i = 0; i < length; i++) {
				//						alert(i);
				var id = selectitems[i].getAttribute('id');
				var type = selectitems[i].getAttribute('data-type');
				//						alert(id+type);
				if (type == "material") {
					//							return;
				} else {
					var choiceitem = document.getElementById(id).getElementsByClassName('selectitem');
					var q = {
						'qid': parseInt(id)
					};
					var line = APP.loki('findOne', q);
					if (line == null) {
						return false;
					} else {
						//							
						var myans = JSON.parse(line.answer);
						//							var myans = MYPAGE.data[id];
						if (typeof(myans) != "undefined") {
							//								myans = myans.split(",");
							//								alert(myans);
							for (var j = 0; j < myans.length; j++) {
								if (type == "determine") {
									//判断处理
									if (myans[j] == 1) {
										choiceitem[0].className = "selectitem onrightitem selected";
									} else if (myans[j] == 0) {
										choiceitem[1].className = "selectitem onwrongitem selected";
									}
								} else {
									//选项处理
									choiceitem[myans[j]].className = "selectitem selected";
								}
							}
						}
					}
				}
			}
			//读取答题数据,显示页面答案	
		},
		onSlideChangeStart: function(swiper) {
			swiper.unlockSwipeToNext();
			var cindex = swiper.activeIndex;
			//			api.toast({
			//				msg:qindex
			//			});
			var thisheight = swiper.slides[cindex].offsetHeight + 'px';
			if (thisheight != "0px") {
				swiper.container[0].style.height = thisheight;
			}
			var oldindex = swiper.previousIndex;
			var nextindexEle = document.getElementsByClassName('swiper-slide-next')[0];
			if (typeof(nextindexEle) == "undefined") {
				nextindex = 2;
			} else {
				nextindex = parseInt(nextindexEle.getAttribute('data-swiper-slide-index')) + 1;
			}
			if (nextindex == 1) {
				nextindex = 11;
			}
			if (cindex > oldindex) {
				qindex++
			} else if (cindex < oldindex) {
				qindex--
			}
			MYPAGE.pageno = qindex + 1;
			if (MYPAGE.pageno < MYPAGE.questionNum || MYPAGE.pageno == MYPAGE.questionNum) {
				var html = template('qitem', data[qindex]);
				swiper.slides[nextindex].innerHTML = html;
				if (nextindex == 11) {
					swiper.slides[1].innerHTML = html;
				}
				if (nextindex == 10) {
					swiper.slides[0].innerHTML = html;
				}
				if (qindex == 1) {

					swiper.lockSwipeToPrev();
					MYPAGE.pageno = 1;
					//					alert(JSON.stringify(data[qindex-1]));
					html = template('qitem', data[qindex - 1]);
					swiper.slides[cindex].innerHTML = html;
				} else {
					swiper.unlockSwipeToPrev();
				}
				window.scrollTo(0, 0);
				api.sendEvent({
					name: 'slideChange',
					extra: {
						pageno: qindex,
						total: MYPAGE.questionNum
					}
				});
			} else {
				swiper.lockSwipeToNext();
				api.toast({
					msg: "没有题目了哦！"
				});
				api.sendEvent({
					name: 'slideChange',
					extra: {
						pageno: qindex,
						total: MYPAGE.questionNum
					}
				});
			}
		},
		onSlideChangeEnd: function(swiper) {
			var selectitems = swiper.slides[swiper.activeIndex].getElementsByClassName('selectitems');
			var length = selectitems.length;
			for (var i = 0; i < length; i++) {
				//						alert(i);
				var id = selectitems[i].getAttribute('id');
				var type = selectitems[i].getAttribute('data-type');
				//						alert(id+type);
				if (type == "material") {
					//							return;
				} else {

					var pageItem = document.getElementsByName(id);
					for (var i = 0; i < pageItem.length; i++) {
						var choiceitem = pageItem[i].getElementsByClassName('selectitem');
						var q = {
							'qid': parseInt(id)
						};
						var line = APP.loki('findOne', q);
						if (line == null) {
							return false;
						} else {
							//							
							var myans = JSON.parse(line.answer);
							//								alert(myans);
							//							var myans = MYPAGE.data[id];
							if (typeof(myans) != "undefined") {
								//								myans = myans.split(",");
								//								alert(myans);
								for (var j = 0; j < myans.length; j++) {
									if (type == "determine") {
										//判断处理
										if (myans[j] == 1) {
											choiceitem[0].className = "selectitem onrightitem selected";
										} else if (myans[j] == 0) {
											choiceitem[1].className = "selectitem onwrongitem selected";
										}
									} else {
										//选项处理
										choiceitem[myans[j]].className = "selectitem selected";
									}
								}
							}
						}
					}


				}
			}
			//读取答题数据,显示页面答案
		}
	});
	api.addEventListener({
		name: 'slideNext'
	}, function(ret, err) {
		swiper.slideNext();
	});
	api.addEventListener({
		name: 'slidePrev'
	}, function(ret, err) {
		swiper.slidePrev();
	});
	api.addEventListener({
		name: 'showAnswer'
	}, function(ret, err) {
		swiper.slides[swiper.activeIndex].getElementsByClassName('jiexiArea')[0].style.visibility = "visible";
	});
	api.addEventListener({
		name: 'Answer'
	}, function(ret, err) {
		swiper.slides[swiper.activeIndex].getElementsByClassName('jiexiArea')[0].style.visibility = "hidden";
	});
	api.addEventListener({
		name: 'favor'
	}, function(ret, err) {
		var qid = swiper.slides[swiper.activeIndex].getElementsByClassName('qid')[0].value;
		addFavor(qid);
	});
	api.addEventListener({
		name: 'toPageIndex'
	}, function(ret, err) {
		if (ret && ret.value) {
			MYPAGE.qindex = ret.value.pageno;
			var cindex = MYPAGE.qindex % 10;
			if (cindex == 0) {
				cindex = 10;
			}
			//			api.toast({
			//				msg: "qindex" + MYPAGE.qindex + ",cindex:" + cindex
			//			});
			swiper.slideTo(cindex, 500, false);
			//数据库读取数据 异步操作
			window.scrollTo(0, 0);
			api.sendEvent({
				name: 'slideChange',
				extra: {
					pageno: MYPAGE.qindex,
					total: MYPAGE.questionNum
				}
			});
			qindex = MYPAGE.qindex;
			if (MYPAGE.qindex == 1) {
				MYPAGE.pageno = MYPAGE.qindex;

				var html = template('qitem', data[0]);
				swiper.slides[swiper.activeIndex].innerHTML = html;
				MYPAGE.pageno = MYPAGE.qindex + 1;
				//页面号+1 同步试题页码
				var html1 = template('qitem', data[1]);
				swiper.slides[swiperNextIndex()].innerHTML = html1;
				swiper.lockSwipeToPrev();
			} else {
				MYPAGE.pageno = MYPAGE.qindex;
				var html = template('qitem', data[MYPAGE.qindex - 1]);
				swiper.slides[cindex].innerHTML = html;
				MYPAGE.pageno = MYPAGE.qindex - 1;
				var html1 = template('qitem', data[MYPAGE.qindex - 2]);
				MYPAGE.pageno = MYPAGE.qindex + 1;
				var html2 = template('qitem', data[MYPAGE.qindex]);
				swiper.slides[cindex - 1].innerHTML = html1;
				swiper.slides[cindex + 1].innerHTML = html2;
			}
		}
	});
}